package com.zn.kjj.util.web;

import java.io.Serializable;

import javax.servlet.http.HttpServletRequest;

/**
 * .
 * @ClassName: SaveRequest
 * @Description: SaveRequest
 * @author w15579
 * 2017年2月24日
 * @version v1.0.0
 */
public class SaveRequest implements Serializable {

    /**
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
     */
    private static final long serialVersionUID = -8040384083931515562L;
    private String method;
    private String queryString;
    private String requestURI;
    /**
     * save
     * @param request
     */
    public SaveRequest(HttpServletRequest request){
        this.method = request.getMethod();
        this.queryString = request.getQueryString();
        this.requestURI = request.getRequestURI();
    }
    public String getMethod() {
        return method;
    }

    public String getQueryString() {
        return queryString;
    }

    public String getRequestURI() {
        return requestURI;
    }
    /**
     * .
     * @Title: getRequestUrl
     * @Description: TODO(这里用一句话描述这个方法的作用)
     * @return 参数说明
     * @since v1.0.0
     */
    public String getRequestUrl() {
        StringBuilder requestUrl = new StringBuilder(getRequestURI());
        if (getQueryString() != null) {
            requestUrl.append("?").append(getQueryString());
        }
        return requestUrl.toString();
    }
}
